<!DOCTYPE html>
<html>
<head>
    <title>商品属性添加</title>
    <link rel="stylesheet" type="text/css" href="<?=base_url('public/css/common.css')?>"/>
    <link rel="stylesheet" type="text/css" href="<?=base_url('public/css/main.css')?>"/>
    <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <!-- ajax提交 -->
    <script type="text/javascript" src="<?=base_url('public/lib/jqusey.form.js')?>"></script>
    <!-- 弹窗插件 -->
    <script type="text/javascript" src="<?=base_url('public/lib/layer/layer.js')?>"></script>
</head>
<body>
    <div class="result-wrap">
    <div class="result-content">
        <form action="<?=site_url('admini/property/create');?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
            <table class="insert-tab" width="100%">
                <tbody>
                <tr>
                    <th><i class="require-red">*</i>属性名称：</th>
                    <td>
                        <input class="common-text required" id="title" name="name" size="50" value="" type="text">
                    </td>
                </tr>
                <tr>
                    <th><i class="require-red">*</i>默认属性值：</th>
                    <td>
                        <input class="common-text required" id="title" name="value" size="50" value="" type="text">
                    </td>
                </tr>
                <tr>
                    <th><i class="require-red">*</i>默认属性值价格：</th>
                    <td>
                        <input class="common-text required" id="title" name="price" size="50" value="<?=$goods['price']?>" type="text">
                    </td>
                </tr>
                <tr>
                    <th></th>
                    <td>
                        <input type="hidden" name="goods_id" value="<?=$goods['id']?>">
                        <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                        <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                        <span>有<i class="require-red">*</i>符号的为必填项</span>
                    </td>
                </tr>
                </tbody></table>
        </form>
    </div>
</div>
<script type="text/javascript">
    $('#myform').submit(function() {
        $(this).ajaxSubmit(function(data){
            if(data == 1){
                var index = parent.layer.getFrameIndex(window.name);
                //parent.layer.msg('属性添加成功！', {shade: 0.3});
                parent.location.reload();  
                parent.layer.close(index);
            }else{
                parent.layer.alert(data,{
                    icon:2,
                });
            }
        })
        return false;
    })
</script>
</body>
</html>